1
|
|
|
/** |
2
|
|
|
* Nextcloud - passman |
3
|
|
|
* |
4
|
|
|
* @copyright Copyright (c) 2016, Sander Brand ([email protected]) |
5
|
|
|
* @copyright Copyright (c) 2016, Marcos Zuriaga Miguel ([email protected]) |
6
|
|
|
* @license GNU AGPL version 3 or any later version |
7
|
|
|
* |
8
|
|
|
* This program is free software: you can redistribute it and/or modify |
9
|
|
|
* it under the terms of the GNU Affero General Public License as |
10
|
|
|
* published by the Free Software Foundation, either version 3 of the |
11
|
|
|
* License, or (at your option) any later version. |
12
|
|
|
* |
13
|
|
|
* This program is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
|
|
|
* GNU Affero General Public License for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Affero General Public License |
19
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
20
|
|
|
* |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
(function () { |
24
|
|
|
'use strict'; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @ngdoc overview |
28
|
|
|
* @name passmanApp |
29
|
|
|
* @description |
30
|
|
|
* # passmanApp |
31
|
|
|
* |
32
|
|
|
* Main module of the application. |
33
|
|
|
*/ |
34
|
|
|
angular |
35
|
|
|
.module('passmanExtension', [ |
36
|
|
|
'ngResource', |
37
|
|
|
'ngRoute', |
38
|
|
|
'ngSanitize', |
39
|
|
|
'pascalprecht.translate', |
40
|
|
|
'angular-steps', |
41
|
|
|
'cgNotify' |
42
|
|
|
]) |
43
|
|
|
.config(function ($routeProvider, $locationProvider) { |
44
|
|
|
$routeProvider |
45
|
|
|
.when('/', { |
46
|
|
|
templateUrl: 'views/list.html', |
47
|
|
|
controller: 'ListCtrl' |
48
|
|
|
}) |
49
|
|
|
.when('/search', { |
50
|
|
|
templateUrl: 'views/search.html', |
51
|
|
|
controller: 'SearchCtrl' |
52
|
|
|
}) |
53
|
|
|
.when('/settings/:tab?', { |
54
|
|
|
templateUrl: 'views/settings.html', |
55
|
|
|
controller: 'SettingsCtrl' |
56
|
|
|
}) |
57
|
|
|
.when('/edit/:guid', { |
58
|
|
|
templateUrl: 'views/edit_credential.html', |
59
|
|
|
controller: 'EditCtrl' |
60
|
|
|
}) |
61
|
|
|
.when('/locked', { |
62
|
|
|
templateUrl: 'views/password_prompt.html', |
63
|
|
|
controller: 'PasswordPromptCtrl' |
64
|
|
|
}) |
65
|
|
|
.when('/setup/', { |
66
|
|
|
templateUrl: 'views/setup.html', |
67
|
|
|
controller: 'SetupCtrl' |
68
|
|
|
}) |
69
|
|
|
.when('/accounts/add', { |
70
|
|
|
templateUrl: 'views/account/add.html', |
71
|
|
|
controller: 'AddAccountCtrl' |
72
|
|
|
}) |
73
|
|
|
.otherwise({ |
74
|
|
|
redirectTo: '/' |
75
|
|
|
}); |
76
|
|
|
$locationProvider.hashPrefix('!'); |
77
|
|
|
}).config(function ($translateProvider) { |
|
|
|
|
78
|
|
|
|
79
|
|
|
/*$translateProvider.useSanitizeValueStrategy('sanitize'); |
80
|
|
|
$translateProvider.useUrlLoader(OC.generateUrl('/apps/passman/api/v2/language')); |
81
|
|
|
$translateProvider.preferredLanguage('en');*/ |
82
|
|
|
}).config(function ($httpProvider) { |
83
|
|
|
$httpProvider.useApplyAsync(true); |
84
|
|
|
}).config( [ |
85
|
|
|
'$compileProvider', |
86
|
|
|
function( $compileProvider ) |
87
|
|
|
{ |
88
|
|
|
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension|moz-extension):/); |
89
|
|
|
// Angular before v1.2 uses $compileProvider.urlSanitizationWhitelist(...) |
90
|
|
|
} |
91
|
|
|
]); |
92
|
|
|
|
93
|
|
|
}()); |
94
|
|
|
|
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.